
<template>
    <div class="top-box">
        <div class="top">
            <img :src="playlist.coverImgUrl" alt="" class="bgimg" />
            <svg class="icon" aria-hidden="true" @click="$router.go(-1)">
                <use xlink:href="#icon-fanhui"></use>
            </svg>
            <span>歌单</span>
            <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-gengduo-shuxiang"></use>
            </svg>

        </div>
        <div class="content">
            <img :src="playlist.coverImgUrl" alt="" class="content-left">
            <span class="count">{{ changeCount(playlist.playCount) }}</span>
            <div class="content-right">
                <p class="name">
                    <span>{{ playlist.name }}</span>
                <div class="xia">
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xiala"></use>
                    </svg>
                </div>
                </p>
                <p class="creator">
                    <img :src="playlist.creator.avatarUrl" alt="" class="avatar">
                    <span class="creator-name">{{ playlist.creator.nickname }}</span>
                    <span class="guanzhu"> + 关注</span>
                </p>
                <p class="tags"> <span v-for="item in playlist.tags">{{ item }} </span> </p>
            </div>
            <div class="des"> {{ playlist.description }}</div>
            <div class="fun">
                <span>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-fenxiang1"></use>
                    </svg>
                    {{ playlist.shareCount }}
                </span>
                <span>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xiaoxi"></use>
                    </svg>
                    {{ playlist.commentCount }}
                </span>
                <span class="red">
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shoucangjia"></use>
                    </svg>
                    {{ playlist.subscribedCount }}
                </span>
            </div>

        </div>


    </div>

</template>
<script setup lang="ts">
const props = defineProps(['playlist'])
console.log(props.playlist);
if (props.playlist.creator = "") {
    props.playlist = JSON.parse(sessionStorage.getItem(itemDetail))
}
const changeCount = num => {
    if (num >= 100000000) {
        return (num / 100000000).toFixed(1) + "亿";
    } else if (num >= 10000) {
        return (num / 10000).toFixed(1) + "万";
    }
}
</script>
<style scoped lang="scss">
.top-box {
    width: 100%;
    position: relative;

    >.top {
        width: 100%;
        height: .54rem;
        box-sizing: border-box;
        padding-top: .1rem;
        padding: 0 .42rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: var(--text);
        position: fixed;
        top: 0;



        >.bgimg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5.54rem;
            filter: blur(30px);
            z-index: 0;


        }

        >span {
            font-size: .32rem;
            z-index: 2;
        }

        .icon {
            font-size: .44rem;
            z-index: 2;

        }
    }

    >.content {

        margin-top: .98rem;
        width: 100%;
        box-sizing: border-box;
        padding: 0 .28rem;
        height: 2.68rem;
        z-index: 10;
        position: relative;

        >.count {
            font-size: .24rem;
            color: #fff;
            position: absolute;
            left: 1.06rem;
            top: .02rem;
        }

        >.content-left {
            display: block;
            width: 1.84rem;
            border-radius: .1rem;
            float: left;
        }

        >.content-right {
            box-sizing: border-box;
            padding-left: .22rem;
            width: 5.1rem;
            height: 1.76rem;
            float: right;
            display: flex;
            flex-direction: column;
            justify-content: space-between;

            >.name {
                display: flex;
                justify-content: space-between;

                >span {
                    display: block;
                    width: 4.36rem;
                    font-size: .28rem;
                }

                >.xia {
                    line-height: .36rem;
                    text-align: center;
                    width: .36rem;
                    height: .36rem;
                    border-radius: 50%;
                    overflow: hidden;
                    backdrop-filter: saturate(180%) blur(20px);
                }
            }

            >.creator {
                width: 2.86rem;
                display: flex;
                justify-content: space-between;
                align-items: center;

                >.avatar {
                    display: block;
                    width: .44rem;
                    height: .44rem;
                    overflow: hidden;
                    border-radius: 50%;
                }

                >.guanzhu {
                    text-align: center;
                    display: block;
                    font-size: 12px;
                    width: .84rem;
                    overflow: hidden;
                    border-radius: 6px;
                    backdrop-filter: saturate(180%) blur(20px);
                }

                >.creator-name {
                    font-size: .24rem;
                }
            }

            >.tags {
                height: .3rem;

                span {
                    text-align: center;
                    display: block;
                    float: left;
                    font-size: .24rem;
                    overflow: hidden;
                    width: .6rem;
                    height: .3rem;
                    border-radius: .1rem;
                    margin-right: .1rem;
                    backdrop-filter: saturate(180%) blur(20px);
                }
            }
        }

        >.des {
            width: 6.96rem;
            height: .28rem;
            overflow: hidden;

            text-overflow: ellipsis;

            position: absolute;
            bottom: .28rem;
            font-size: .24rem;


        }
        >.fun{
            width: 6.96rem;
            height: .72rem;
            position: absolute;
            bottom: -1.08rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            span{
                display: block;
                width: 2.2rem;
                height: .72rem;
                text-align: center;
                line-height: .72rem;
                overflow: hidden;
                border-radius: .28rem;
                backdrop-filter: saturate(180%) blur(20px);
                font-size: .24rem;
                .icon{
                    width: .32rem;
                    height: .36rem;
              

                }
            }
            >.red{
                background-color: #ea4a4a;
            
            }
        }
    }

}
</style>